/*
 * LinkedList.h
 *
 *  Created on: Apr 6, 2013
 *      Author: Anthony Varghese
 */

#ifndef LINKEDLIST_H_
#define LINKEDLIST_H_

namespace assignment3 {

class LinkedList {
private:
	struct Node{
		enum gender { boy, girl };
		short  year;
		string name;
		double percent;
		gender sex;
		Node*  next;
		Node*  prev;
	};

public:
	LinkedList();
	LinkedList(const LinkedList& source);
	virtual ~LinkedList();
	LinkedList& operator =(const LinkedList& rhs);
	void sortByName();
	void sortByPopularity();
	void sortByYear();
private:
	Node* first;
	friend ostream& operator<<(ostream& os, const Node& n);
	friend istream& operator>>(istream& is, Node& n);
	friend istream& operator>>(istream& is, LinkedList& bn);
	friend ostream& operator<<(ostream& os, const LinkedList& bn);
};
istream& operator>>(istream& is, LinkedList& bn);
ostream& operator<<(ostream& os, const LinkedList& bn);

} /* namespace assignment3 */
#endif /* LINKEDLIST_H_ */
